package async.runAsync;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;

public class Demo2 {
    public static void main(String[] args) {
        ExecutorService executor = Executors.newFixedThreadPool(100);
        CompletableFuture<Void> future = CompletableFuture.runAsync(() -> {
            try {
                TimeUnit.SECONDS.sleep(3);
                System.out.println("child run");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        },executor);
        System.out.println("main end");
        executor.shutdown();
    }
}
